package com.ruoyi.system.mapper;

import java.util.List;
import com.ruoyi.system.domain.InvoiceServiceDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 【请填写功能名称】Mapper接口
 * 
 * @author ruoyi
 * @date 2025-01-16
 */
public interface InvoiceServiceDetailMapper 
{
    /**
     * 查询【请填写功能名称】
     * 
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    public InvoiceServiceDetail selectInvoiceServiceDetailById(Long id);

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param invoiceServiceDetail 【请填写功能名称】
     * @return 【请填写功能名称】集合
     */
    public List<InvoiceServiceDetail> selectInvoiceServiceDetailList(InvoiceServiceDetail invoiceServiceDetail);

    /**
     * 新增【请填写功能名称】
     * 
     * @param invoiceServiceDetail 【请填写功能名称】
     * @return 结果
     */
    public int insertInvoiceServiceDetail(InvoiceServiceDetail invoiceServiceDetail);

    /**
     * 修改【请填写功能名称】
     * 
     * @param invoiceServiceDetail 【请填写功能名称】
     * @return 结果
     */
    public int updateInvoiceServiceDetail(InvoiceServiceDetail invoiceServiceDetail);

    /**
     * 删除【请填写功能名称】
     * 
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    public int deleteInvoiceServiceDetailById(Long id);

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteInvoiceServiceDetailByIds(Long[] ids);

    @Select("<script>" +
            "select service_charge from invoice_service_detail where 1=1 and company='中心库' " +
            "<if test=\"startTime!=null and startTime!= ''\">" +
            " and invoice_time = #{startTime} " +
            "</if>" +
            "<if test=\"provide!=null and provide!= ''\">" +
            " and provider = #{provide} " +
            "</if>" +
            "</script>")
    public Double selectMoney(@Param("provide")String provide, @Param("startTime")String startTime);

    @Select("<script>" +
            "select service_charge from invoice_service_detail where 1=1 and company='供应商' " +
            "<if test=\"startTime!=null and startTime!= ''\">" +
            " and invoice_time = #{startTime} " +
            "</if>" +
            "<if test=\"provide!=null and provide!= ''\">" +
            " and provider = #{provide} " +
            "</if>" +
            "</script>")
    public Double selectAllMoneyPrice(@Param("provide")String provide,@Param("startTime")String startTime);

}
